<template>
  <svg :class="classList" aria-hidden="true">
    <use :xlink:href="iconName" />
  </svg>
</template>
<script setup lang="ts" name="SvgIcon">
import { computed, defineProps } from 'vue'
const props = defineProps({
  class: { type: String, default: '' },
  icon: { type: String, required: true }
})
const classList = computed(() => {
  return ['os-icon', props.class || '']
})
const iconName = computed(() => {
  return `#icon-${props.icon}`
})
</script>
<style scoped>
.os-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
